<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('LED列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="text-align: center;width:80px">LED屏状态：</label>
                        </li>
                        <li>
                            <label class="radio-box">
                                <input type="radio" checked="" value="" id="optionsRadios1" name="status">全部</label>
                        </li>
                        <li>
                            <label class="radio-box">
                                <input type="radio" checked="" value="1" id="optionsRadios2" name="status">在线</label>
                        </li>
<!--                        <li>-->
<!--                            <label>LED屏状态&nbsp;</label>-->
<!--                            <label class="radio-box">-->
<!--                                <input type="radio" checked="" value="1" id="optionsRadios1" name="status">全部</label>-->
<!--                            <label class="radio-box">-->
<!--                                <input type="radio" value="1" id="optionsRadios2" name="status">在线</label>-->
<!--                            <label class="col-sm-3 control-label">单选框：</label>-->
<!--                            <div class="col-sm-9">-->
<!--                                <label class="radio-box">-->
<!--                                    <input type="radio" checked="" value="option1" id="optionsRadios1" name="optionsRadios">选项1</label>-->
<!--                                <label class="radio-box">-->
<!--                                    <input type="radio" value="option2" id="optionsRadios2" name="optionsRadios">选项2</label>-->
<!--                            </div>-->
<!--                        </li>-->

                        <li>
                            <label style="text-align: center;width:80px">LED屏名称：</label>
                            <input type="text" placeholder="请输入设备名称" name="ledName"/>
                        </li>

                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="color"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="widthHeigh"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" class="time-input" placeholder="请选择" name="startDate"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" class="time-input" placeholder="请选择" name="endDate"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="adsCount"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="waitJobCount"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="modelName"/>-->
                        <!--                            </li>-->
                        <!--                            <li>-->
                        <!--                                <label>：</label>-->
                        <!--                                <input type="text" name="versionName"/>-->
                        <!--                            </li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>


            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">

            <div class="bs-glyphicons">
                <ul class="bs-glyphicons-list">
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                        <span class="glyphicon-class">设置</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-share" aria-hidden="true"></span>
                        <span class="glyphicon-class">移动设备</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-indent-left" aria-hidden="true"></span>
                        <span class="glyphicon-class">分组管理</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span>
                        <span class="glyphicon-class">LED屏授权</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span>
                        <span class="glyphicon-class">解除授权</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span>
                        <span class="glyphicon-class">上下线记录</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                        <span class="glyphicon-class">高级设置</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
                        <span class="glyphicon-class">导出</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                        <span class="glyphicon-class">清除任务</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-text-width" aria-hidden="true"></span>
                        <span class="glyphicon-class">批量重命名</span>
                    </li>
                    <li style="width: 90px; height:70px; ">
                        <span class="glyphicon glyphicon-yen" aria-hidden="true"></span>
                        <span class="glyphicon-class">充值</span>
                    </li>
                </ul>
            </div>


            <!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ads:edit">-->
            <!--&lt;!&ndash;                    <i class="fa fa-edit"></i> 修改&ndash;&gt;-->
            <!--                    <li>-->
            <!--                        <span class="glyphicon glyphicon-tower" aria-hidden="true"></span>-->
            <!--                        <span class="glyphicon-class">glyphicon glyphicon-tower</span>-->
            <!--                    </li>-->
            <!--                </a>-->
            <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ads:remove">-->
            <!--                    <i class="fa fa-remove"></i> 删除-->
            <!--                </a>-->
            <!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ads:export">-->
            <!--                    <i class="fa fa-download"></i> 导出-->
            <!--                </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ads:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ads:remove')}]];
    var statusDatas = [[${@dict.getType('led_status')}]];
    var prefix = ctx + "led/ads";
    // 根据当前激活的选项卡获取（方式一）
    function selectUsersToParent2(id){
        $.modal.open("LED屏在线广告列表", prefix + "/parent?id="+id);
    }
    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "LED",
            columns: [{
                checkbox: true,
                color: 'green'
            },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'ledName',
                    title: 'LED屏名称'
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'color',
                    title: '屏彩'
                },
                {
                    field: 'widthHeigh',
                    title: '屏宽高'
                },
                {
                    field: 'startDate',
                    title: '上线时间'
                },
                {
                    field: 'endDate',
                    title: '下线时间'
                },
                {
                    field: 'adsCount',
                    title: '广告数量'
                },
                {
                    field: 'waitJobCount',
                    title: '待发任务'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>重命名</a> ');
                        actions.push('<a class="btn btn-primary btn-xs" href="javascript:;" ></i>定位</a> ');
                        // actions.push('<a class="btn btn-success btn-xs' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-remove"></i>查看广告</a>');
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="selectUsersToParent2('+row.id+')"><i class="fa fa-remove"></i>查看广告</a>');
                        return actions.join('');
                    }
                    // formatter: function(value, row, index) {
                    //     var actions = [];
                    //     actions.push('<a class="btn btn-success btn-xs" href="javascript:;" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>重命名</a> ');
                    //     actions.push('<a class="btn btn-info btn-xs" href="javascript:;" onclick="$.operate.detail(\'' + row.userId + '\')"><i class="fa fa-search"></i>定位</a> ');
                    //     actions.push('<a class="btn btn-danger btn-xs" href="javascript:;" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>查看广告</a>');
                    //     return actions.join('');
                    // }
                },

                {
                    field: 'modelName',
                    title: '型号'
                },
                {
                    field: 'versionName',
                    title: '版本'
                }
            ]
        };

        $.table.init(options);
    });
</script>
</body>
</html>